package com.zz.springboot.resp.enums;

/**
 * 错误枚举
 */
public enum RespCodeEnum implements BasicEnum {

    //1.成功
    SUCCESS("000000","成功"),


    //2.业务异常
    USER_NOT_EXISTS("100001","用户不存在"),
    INSERT_DATA_FAIL("100002","插入数据失败"),
    PARSE_TXT_FAIL("100003","文本解析错误"),
    DUPLICATE_NUM("100004","存在重复号码！"),
    CONTENTS_FORMAT_INCORRECT("100005","文本格式错误"),
    REGISTER_USER_FAIL("100006","注册用户失败"),
    USER_ALREADY_EXISTS("100007","用户已存在"),
    USERNAME_OR_PASSWORD_ERROR("100008","用户名或密码错误"),
    LOGIN_FAILED("100009","登录异常"),
    ASSIGN_ROLE_FAIL("100010","分配角色失败"),
    USER_NOT_AUTHORIZED("100011","用户未授权"),
    SET_PARAM_FAIL("100012","设置参数失败"),
    UPDATE_VALID_DAYS_FAIL("100013","设置用户有效天数失败"),
    DICTIONARY_NOT_FOUND("100014","字典或映射关系不存在"),


    //3.系统异常：给出友好提示
    SYSTEM_FAIL("999999","服务器繁忙，请稍后再试！"),
    IO_EXCEPTION("777777","IO异常"),


    //4.参数校验异常
    PARAMS_VERIFY_FAIL("888888","参数校验失败！")
    ;


    String code;
    String msg;


    RespCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    @Override
    public String getErrCode() {
        return code;
    }


    @Override
    public String getErrMsg() {
        return msg;
    }
}